<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-L-admin1.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script src="../js/jquery.min.js"></script>
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
</head>
<body>
<div class="x-body layui-anim layui-anim-up">
    <blockquote class="layui-elem-quote">欢迎您，
        <b><font size="4px">教师用户</font></b>：
        <span class="x-red" id="teaNameWel">这里改成获取用户名</span>！&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;本次登录时间:
        <a id="time">这里设置动态时间获取函数</a></blockquote>
    <fieldset class="layui-elem-field">
        <legend>您的相关信息：</legend>
        <div class="layui-field-box">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="layui-carousel x-admin-carousel x-admin-backlog" lay-anim="" lay-indicator="inside"
                             lay-arrow="none" style="width: 1000px; height: 550px;">
                            <div carousel-item="">
                                <ul class="layui-row layui-col-space10 layui-this">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>您的id号</h3>
                                        <p><cite id="teaId">这里显示用户的id号码</cite></p>
                                        <a onClick="x_admin_show('修改密码','../html/changeTeaPwd.html')"><button class="layui-btn layui-btn-danger" >
                                            <i class="layui-icon">修改密码&#xe642;</i></button></a>
                                        <br>
                                    </a>
                                    <br>

                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>您的用户名</h3>
                                        <p><cite id="teaName">这里显示用户的用户名</cite></p>
                                        <a onClick="x_admin_show('修改用户名','../html/changeTeaUname.html')"><button class="layui-btn layui-btn-danger">
                                            <i class="layui-icon">修改用户名&#xe642;</i></button></a>
                                        <br>
                                    </a>
                                    <br>

                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>您当前所属的专业</h3>
                                        <p><cite id="teaDl">这里调用获取数据库专业的接口</cite></p>
                                        <a onClick="x_admin_show('修改专业','../html/changeTeaDiscipline.html')"><button class="layui-btn layui-btn-danger">
                                            <i class="layui-icon">修改专业&#xe642;</i></button></a>
                                        <br>
                                    </a>
                                    <br>

                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>您绑定的电子邮箱</h3>
                                        <p><cite id="teaMail">这里调用获取数据库教师电子邮箱的接口</cite></p>
                                        <a onClick="x_admin_show('修改邮箱','../html/changeTeaEmail.html')"><button class="layui-btn layui-btn-danger">
                                            <i class="layui-icon">修改邮箱&#xe642;</i></button></a>
                                        <br>
                                    </a>
                                    <br>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </fieldset>
    </div>

<script type="text/javascript">
    var id=sessionStorage.getItem("teaId");
    console.log(id);
    document.getElementById("time").innerHTML=new Date();
    $.ajax({
        url: "/teacher/getinfo",
        type : "post",
        async: false,
        dataType: "json",
        data :{ teaNo: id},
        // contentType: "application/json",
        success: function (data) {
            console.log("请求成功");
            console.log(data);
            document.getElementById("teaNameWel").innerHTML=data.teaName;
            document.getElementById("teaName").innerHTML=data.teaName;
            document.getElementById("teaId").innerHTML=data.teaNo;
            document.getElementById("teaMail").innerHTML=data.teaMail;
            document.getElementById("teaDl").innerHTML=data.teaDiscipline;
            return;
        },
        error: function (data) {
            console.log("请求失败");

            return;
        }
    });
</script>

</body>
</html>